import { ParamsObjType as _ParamsObjType, PaginationParamsType } from "@/library/common/types"

type _UseAllType = {
    Id: number
    Name: string
    Code: string
    Token: string
    Address: string
    ManagerId: number
    PhoneNumber: string
    Enable: boolean
    UpdatedAt: string
    CreatedAt: string
}

type _DialogPropsType<T> = {
    visible: boolean
    editForm: Partial<T>
}

/**
 * 查询参数
*/
export type SelectParamsType = Partial<Pick<_UseAllType, 'Id' | 'Name' | 'Code'>> & PaginationParamsType

/**
 * 查询响应 Data
 */
export type DataType = Omit<_UseAllType, ''>

/**
 * 更新
 */
export type UpdateType = Pick<_UseAllType, "Id" | "Name" | "Token" | "Code" | "Address" | "Enable" | "PhoneNumber">

/**
 * 新增
 */
export type InsertType = Omit<UpdateType, "Id">

export type EditDialogType = _DialogPropsType<UpdateType>

/**
 * 删除
 */
export type DeleteType = Pick<_UseAllType, "Id">

/**
 * 获取下拉参数
 */
export type ParamsType = {
    Dishes: any[],
    ShopManager: _ParamsObjType[]
}
export type ParamsObjType = Partial<Record<keyof ParamsType, Record<string, string>>>

/**
 * 绑定/换绑 门店管理员
 */
export type BindManagerType = {
    ManagerId: number
    ShopCode: string
}
export type BindManagerDialogType = _DialogPropsType<BindManagerType> & { isBindManager: boolean }

/**
 * 解绑管理员
*/
export type UnbindManagerType = Pick<BindManagerType, 'ShopCode'>